home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / program / amcfp140.lha / AMCAF_Examples / Protracker2.AMOS / Protracker2.amosSourceCode
AMOS Source Code  |  1996-01-19  |  3KB  |  85 lines

  1. ' ************************************* Commands used: 
  2. ' *                                   * Imploder Load      Blitter Clear 
  3. ' *           Amcaf Examples          * Pt Cia Speed       Turbo Draw
  4. ' *   More Protracker Commands V1.0   * Pt Play            Blitter Fill
  5. ' *      Written by Chris Hodges      * =Pt Cnote
  6. ' *                                   * =Pt Cinstr 
  7. ' ************************************* =Pt Vu 
  8. '                          
  9. ' Hide the mouse cursor, because we need sprite 0. 
  10. Hide 
  11. ' Load some music first. Hawkeye is a tune by Smt/Haujobb (Sascha Theel).
  12. ' The original tune comes from the Manics of Noise on the C64. 
  13. ' This is one of my favourite chip tunes. ;-)
  14. ' Musics have to be loaded into chipmem, so the banknumber is negativ. 
  15. ' The music file has been file imploded to save a mere 40 KB of valuable 
  16. ' disk space.
  17.  Extension_8_0EA2 "Data/mod.hawkeye",-3
  18. '�Open an eight colours screen. I used a two colours one in the past,
  19. ' but it wasn't that nice to follow the dots then...   
  20. Screen Open 0,320,256,8,Lowres
  21. Curs Off : Flash Off : Paper 0 : Pen 1 : Cls 
  22. ' Define some colors.
  23. Palette $8,$FFF,$C00,$CC0,$C0,$C0C
  24. ' Draw the box before switching to double buffer mode. 
  25. Ink 1 : Box 31,167 To 288,249
  26. ' Use double buffering for a flicker free display. 
  27. Double Buffer 
  28. Autoback 0
  29. ' Create a nice copper bar.
  30. Set Rainbow 0,1,40,"","",""
  31. For A=0 To 39
  32.   Rain(0,A)=Max(Min(A-15,15),0)*$100+Min(A,15)*$10+Max(Min(A/2-8,15),0)
  33. Next 
  34. Rainbow 0,0,Y Hard(-1),162
  35. ' Dim a field to hold the current frequence-o-meter state. 
  36. Dim FR(31,3)
  37. ' Start the music. 
  38.  Extension_8_10F2 0
  39.  Extension_8_10C6 64
  40.  Extension_8_10D6 15
  41.  Extension_8_108E 3
  42. ' Main loop
  43. Repeat 
  44.   ' Clear the old frequence-o-meters.
  45.    Extension_8_1234 0,0,32,0 To 288,160
  46.   ' This little routine gets the frequency of a channel
  47.   ' and therefore creates the height of the bars.  
  48.   For A=0 To 3
  49.     If Extension_8_15FE(A)
  50.       F=Min(Max(( Extension_8_160E(A)-5000)/800,0),31)
  51.       FR(F,A)=Min(FR(F,A)+16,32)
  52.       If F>0 : FR(F-1,A)=Min(FR(F-1,A)+4,32) : End If 
  53.       If F<31 : FR(F+1,A)=Min(FR(F+1,A)+4,32) : End If 
  54.     End If 
  55.   Next 
  56.   ' Now draw all four frequence-o-meters 
  57.   For A=0 To 3
  58.     For F=0 To 31
  59.       H=FR(F,A)
  60.       If H
  61.          Extension_8_1030 F*8+35,32-H+A*40 To F*8+32,32+A*40,1,-1
  62.          Extension_8_1030 F*8+36,32-H+A*40 To F*8+39,32+A*40,1,-1
  63.       End If 
  64.       FR(F,A)=Max(H-2,0)
  65.     Next 
  66.     ' This dot draws the bottom line ;-) 
  67.      Extension_8_0388 287,34+A*40,1
  68.   Next 
  69.   ' Now fill the bars
  70.    Extension_8_1066 0,0,32,0,288,160
  71.   ' Scroll the note field and wait for the operation to finish.  
  72.   Screen Copy Physic(0),33,168,288,249 To Logic(0),32,168
  73.    Extension_8_1258 
  74.   ' Now draw the dots if the channel has been triggered. 
  75.   For A=0 To 3
  76.     If Extension_8_15FE(A) Then Extension_8_0388 286,248-Min(Max(( Extension_8_160E(A)-3000)/400,0),75),Max(2+A- Extension_8_10E6(A)*4,1)
  77.   Next 
  78.   ' Swap the screens and sync with the beam
  79.   Screen Swap 
  80.   Wait Vbl 
  81. Until I$=Chr$(27) or Mouse Key
  82.  Extension_8_10A8 
  83. Screen Close 0
  84. Rainbow Del : View : Wait Vbl 
  85. End